package com.miao.im.support.disruptor;

import com.miao.im.common.enums.EventType;
import com.miao.im.support.pulisher.BaseEvent;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.Getter;

/**
 * @Auther: miaoguoxin
 * @Date: 2021/3/18 11:26
 * @Description:
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class DisruptorEvent<T> extends BaseEvent {
    /**事件类型*/
    private EventType eventType;
    /**消息载体*/
    private T payload;

    public DisruptorEvent() {
        super.time = System.currentTimeMillis();
    }

    public DisruptorEvent(EventType eventType, T payload) {
        this();
        this.eventType = eventType;
        this.payload = payload;
    }
}
